﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="list_pjgz.aspx.cs" Inherits="系统管理_list_pjgz" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>平均工资管理</title>
</head>
<body>
<fieldset>
<legend>平均工资管理</legend>

    <form id="form1" runat="server">
    <div>
        <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/系统管理/add_pjgz.aspx">添加新项</asp:LinkButton><br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSource1"
            ForeColor="#333333" PageSize="20">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:BoundField DataField="year" HeaderText="所属年份" SortExpression="year" />
                <asp:BoundField DataField="salary" HeaderText="平均工资" SortExpression="salary" />
                <asp:TemplateField HeaderText="启用标记" SortExpression="flag">
                    <EditItemTemplate>
                        <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal"
                            SelectedValue='<%# Bind("flag") %>'>
                            <asp:ListItem Value="1">启用</asp:ListItem>
                            <asp:ListItem Value="0">未启用</asp:ListItem>
                        </asp:RadioButtonList>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("flag") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" HeaderText="操作" />
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <EmptyDataTemplate>
                没有数据
            </EmptyDataTemplate>
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:insurance_dbConnectionString %>"
            DeleteCommand="DELETE FROM [平均工资表] WHERE [id] = @id" InsertCommand="INSERT INTO [平均工资表] ([year], [salary], [flag]) VALUES (@year, @salary, @flag)"
            SelectCommand="SELECT * FROM [平均工资表] ORDER BY [year] DESC" UpdateCommand="UPDATE [平均工资表] SET [year] = @year, [salary] = @salary, [flag] = @flag WHERE [id] = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="year" Type="Int32" />
                <asp:Parameter Name="salary" Type="Double" />
                <asp:Parameter Name="flag" Type="Int32" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="year" Type="Int32" />
                <asp:Parameter Name="salary" Type="Double" />
                <asp:Parameter Name="flag" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</fieldset>
</body>
</html>
